import request from '@/router/axios';

/**
 * @param data 新增实体模型
 * */
export const add = (data) => {
  return request({
    url: '/api/manager-api/mx-type/create',
    method: 'post',
    data
  })
}

/**
 * @param params 获取实体下的属性
 * */
export const getTypeAllAttributeByName = (params) => {
  return request({
      url: '/api/manager-api/mx-type/getTypeAllAttributeByName',
      method: 'get',
      params
  })
}
/**
 *@param params  获取from 和 to 实体
 * */
 export const from_to = (params) => {
  return request({
      url: '/api/manager-api/mx-type/latestReleaseListIncludedBaseObject',
      method: 'get',
      params
  })
}


/**
 * @param data 修改实体模型
 * */
export const update = (data) => {
  return request({
    url: '/api/manager-api/mx-type/update',
    method: 'post',
    data
  })
}

/**
 * @param params 获取实体模型列表 不分页
 * */
export const getEntity = (params) => {
  return request({
    url: '/api/manager-api/mx-type/list',
    method: 'get',
    params
  })
}

/**
 * @param params 获取实体模型列表 分页
 * */
export const getQueryEntity = (params) => {
  return request({
    url: '/api/manager-api/mx-type/queryTypeList',
    method: 'get',
    params
  })
}
/**
 * @param data 发布实体
 * */
export const publish = (data) => {
  return request({
    url: '/api/manager-api/mx-type/publish',
    method: 'post',
    data
  })
}

/**
 *
 * @param  data 检出实体
 */
export const checkout = (data) => {
  return request({
    url: '/api/manager-api/mx-type/checkout',
    method: 'post',
    data
  })
}

/**
 *
 * @param  data 修订实体
 */
export const revise = (data) => {
  return request({
    url: '/api/manager-api/mx-type/amendment',
    method: 'post',
    data
  })
}

/**
 *@param params 获取
 * functionInterfaces 功能接口列表
 * implInterfaces 实现的接口列表
 * extendsInterfaces 继承的接口列表
 * attributes 扩展属性列表
 * extendsAttributes 继承的属性列表
 * */
export const getDetail = (params) => {
  return request({
    url: '/api/manager-api/mx-type/detail',
    method: 'get',
    params
  })
}


/**
 * @param params 获取实体模型 不分页
 * */
export const getEntityModules = (params) => {
  return request({
    url: '/api/manager-api/mx-type/allTypeList',
    method: 'get',
    params
  })
}

export const getEntityLatest = (params) => {
  return request({
    url: '/api/manager-api/mx-type/latest',
    method: 'get',
    params
  })
}


export const del = (data) => {
  return request({
    url: '/api/manager-api/mx-type/delete',
    method: 'post',
    data
  })
}



export const discard = (data) => {
  return request({
    url: '/api/manager-api/mx-type/discard',
    method: 'post',
    data
  })
}
